<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    //相邻边距塌陷
    <div style="height: 100px;width: 100px;background:red;margin: 50px;">
        gij
    </div>
    
    <div style="height: 100px;width: 100px;background:blue;margin: 50px;">
        uio
    </div>

    //父子边距塌陷
    <!-- 
        解决：父元素中加入
        float: left
        position: absolute
        padding: 1px
        overflow: hidden
     -->
    <div style="height: 100px;width: 100px;background:red;margin: 50px;overflow: hidden;">
        <div style="height: 30px;width: 30px;background:blue;margin: 20px;">
            uio
        </div>
    </div>
    
    
</body>
</html>